<form name="templates" id="templates" onSubmit="return checkSubmit()" action='sendtemplate_process.php' method="post">
<div align="center">

		<input name="back" type="button" value="&#060;&#060; Back" class="dialogbutton" onclick="javascript:history.go(-1)">
		<input name="submit" type="submit" value="Send &#062;&#062;" class="dialogbutton">
		<input name="cancel" type="button" value="Cancel" class="dialogbutton" onclick="window.location.href='index.php';" >
</div>
	<!-- <table width="100%" border="0">
		<tr><td colspan="2">
			<fieldset class="templateblock" id='alltemp'>
			<legend><span class="textbold" unselectable="on">Templates</span></legend>
			<table>
			<tr>
			<th><span>T</span></th>
			<th><span>Templates</span></th>
			</tr>
			<?php
			$templates= mysql_query("select * from templates");
			while($tempr=mysql_fetch_array($templates))
			{
				$tempid=$tempr['content_id'];
				$tempname=$tempr['title'];

				echo "<tr>";
				echo "<td><input type='checkbox' name='temps' id='temps' value='$tempid'></td>";
				echo "<td>$tempname</td>";
				echo "</tr>";

			}
			?>
			</table>
			</fieldset>
		</td></tr>
	</table> -->
	<?php $temp=$_REQUEST['temp_id']; ?>
	<table><tr><td><input type="hidden" name="temp_id" value='<?php echo $temp; ?>'></td></tr></table>

<table width="100%">
		<tr><td>
		
		<fieldset class="templateblock" id='allresources'>

			<legend><span class="textbold" unselectable="on">Resources</span></legend>
			<table >
			<tr>
			<th><span><input type='checkbox' name='listSelectAllresources' id='listSelectAllresources'/></span></th>
			<th><span>Resources</span></th>
			</tr>
			<?php
			$resources= mysql_query("select * from user_master where customer_id=$customerid and vendor_id=0");
			while($resourcesr=mysql_fetch_array($resources))
			{
				
				$uname=$resourcesr['user_name'];
				$resourcename=$resourcesr['first_name']." ".$resourcesr['last_name'];
				echo "<tr>";
				echo "<td><input type='checkbox' name='emails[]' id='resources' value='$uname'></td>";
				echo "<td>$resourcename</td>";
				echo "</tr>";

			}
			?>
			</table>
			</fieldset>
			
			<fieldset class="templateblock" id='allclients'>

			<legend><span class="textbold" unselectable="on">Clients</span></legend>
			<table >
			<tr>
			<th><span><input type='checkbox' name='listSelectAllclients' id='listSelectAllclients'/></span></th>
			<th><span>Clients</span></th>
			</tr>
			<?php
			$clients= mysql_query("select * from client_master where client_created_by=$userId");
			while($clir=mysql_fetch_array($clients))
			{
				$clientid=$clir['client_id'];
				$clientname=$clir['client_name'];
				$uname=$clir['user_name'];

				echo "<tr>";
				echo "<td><input type='checkbox' name='emails[]' id='clients' value='$uname'></td>";
				echo "<td>$clientname</td>";
				echo "</tr>";

			}
			?>
			</table>
			</fieldset>


			
	
		<fieldset class="templateblock" id='allvendors'>
		<legend><span class="textbold" unselectable="on">Venders</span></legend>
		<table>
		<tr>
		<th><span><input type='checkbox' name='listSelectAllvendors' id='listSelectAllvendors'/></span></th>
		<th><span>Vendors</span></th>
		</tr>
		<?php
		$vendors= mysql_query("select * from vendor_master where vendor_created_by=$userId");
		while($vendorr=mysql_fetch_array($vendors))
		{
			$vendorid=$vendorr['vendor_id'];
			$vendorname=$vendorr['vendor'];

			echo "<tr>";
			echo "<td><input type='checkbox' name='emails[]' id='vendors' value='$vendorid'></td>";
			echo "<td>$vendorname</td>";
			echo "</tr>";

		}
		?>
		
		</table>
		</fieldset>

		</td>

		</tr>
</table>



</form>